#ifndef SUPPORT_H
#define SUPPORT_H

#include <QSharedPointer>
#include <QString>
#include <QVector>

//#include "geometry/mesh.h"
//#include "regions/island.h"
#include "support/pillar.h"
#include "units/unit.h"
#include "part/part.h"

//namespace ORNL
//{
//    class Mesh;
//    class PolygonList;
//    /**
//     * \brief structure to store tree branching points
//     */
//    struct treePoint
//    {
//        Point p;
//        Point shift;
//        treePoint* parent = nullptr;
//        QVector< treePoint* > child;
//        int leaf = 0;
//        PolygonList pl;
//    };

//    class Support
//    {
//    private:
//        int total_layers;
//        QString supportType;
//        QVector< QSharedPointer< Pillar > > pillars;
//        //QSharedPointer< Mesh > mesh;
//        QSharedPointer< PartBase > mesh;
//        QVector< treePoint* > leaves;
//        float area_ratio;
//        Distance layerHeight;

//        //
//    public:
//        QVector< treePoint* > heads;
//        //

//        Area thresholdArea;
//        /*TODO    TODO  TODO*/
//        Distance threshhold_distance = 10; /*Distance of a hanging point, from
//                                   the closest boundary point of lower layer, to
//                                   be labelled as overhanging point.  */
//    public:
//        /*Constructor*/
//        /**
//         * \brief Intializes support class object and is the point-of-contact
//         *  function for accessing all features.
//         * \param1 support type to generate
//         * \param2 Pointer to the mesh
//         * \param3 threshold angle for overhanging parts
//         * \param4 height of a layer
//         * \param5 smallest area that can be printed by a extruder. Should be
//         * left unutilised for dropdown support structure
//         * \param6 Ratio to which the initial surface area of a support
//         * structure needs to taper to. Needs to be filled up for initialised
//         * for tapperingsupport structure
//         **/
//        Support(QString supportType, QSharedPointer< PartBase> mesh, //Mesh > mesh,
//         float angle, Distance layer_height,
//             Area threshArea=0, float ratio=0);
//        private:
//        /**
//         * \brief Processes a mesh layer by layer to find hanging section areas
//         * \param1 the mesh to be processed.
//         */
//        void findOverhang();

//        /**
//         * \brief Generate the support outline for overhang areas of a layer.
//         * This functions takes care of building dropdown and teappering
//         * structures. It also generates the forest support structure.
//         *
//         * \param1 the current layer containing the overhang
//         * \param2 the layer below where support outlines need to be added.
//         */
//        void generateSupport(QSharedPointer< Layer > cur_layer,
//                             QSharedPointer< Layer > below_layer,
//                             QVector< QSharedPointer< Island > > support_island,
//                             QVector< PolygonList > support_overhang);

//        /**
//         * Generates pathes of minimal area that needs support, so that the
//         * entire overhang area can be supported using minimum volume of
//         * material
//         */
//        QVector< PolygonList > generatePatch(PolygonList supportAreas,
//                                             bool tree = false);

//        /**
//         * \brief adds a new pillar to the suport structure.
//         */
//        void addNewPillar(PolygonList supportAreas,
//                          QSharedPointer< Layer > below_layer,
//                          Pillar* cur_support_pillar = nullptr);

//        /**
//         * \brief Processes, and calculates the merging speed of each node in
//         *  the tree support structure
//         */
//        void processTree(treePoint* head);

//        /**
//         * Generates the tree support structure using the processed tree data
//         * structure generated by generatePatch and generateTree functions
//         */
//        void generateTree(PolygonList cur_layer_outline,
//                          QSharedPointer< Layer > cur_layer);
//        /*
//        QVector< PolygonList > generateSectors(PolygonList supportAreas,
//                                               int level     = -1,
//                                               int mark      = -1,
//                                               treePoint* tr = nullptr,
//                                               Point mid     = Point());
//        QVector< Polygon > splitTriangle(Point p1,
//                                         Point p2,
//                                         Point p3,
//                                         Point p4);

//        QVector< Polygon > splitRect(Point p1, Point p2, Point p3, Point p4);

//        QVector< Point > mid(Point p1, Point p2, Point p3, Point p4);
//        */
//    };
//}  // namespace ORNL
#endif  // SUPPORT_H
